Dynamic determination of needed agent rules

ABSTRACT

A method for updating rule statistics in an execution environment by an agent that utilizes a rule engine, comprising collecting an activation statistic when a rule is activated, collecting a firing statistic when a rule is fired; and storing the activation statistic and the firing statistic in a rule history once processing by the rule engine is complete.

CROSS-REFERENCE TO RELATED PATENT APPLICATIONS

This application is a Divisional of U.S. application Ser. No. 11/645191,filed Dec. 22, 2006, incorporated herein by reference in its entirety.

FIELD

The present disclosure is generally related to software agents and moreparticularly to software agents' use of rule-based systems.

BACKGROUND

Agents

A software agent is a software abstraction, similar to theobject-oriented programming concept of an object. The concept of anagent provides a convenient and powerful way to describe a complexsoftware entity that is capable of acting with a certain degree ofautonomy in order to accomplish tasks on behalf of its user. But unlikeobjects, which are defined in terms of methods and attributes, an agentis defined in terms of its behavior.

Various authors have proposed different definitions of agents, commonlyincluding concepts such as:

Persistence—code is not executed on demand but runs continuously anddecides for itself when it should perform some activity

Autonomy—agents have capabilities of task selection, prioritization,goal-directed behavior, decision-making without human intervention

Social Ability—agents are able to engage other components throughcommunication and coordination, they may collaborate on a task

Reactivity—agents perceive the context in which they operate and reactto it appropriately.

Agents may also be mobile. They can move from one execution environmentto another carrying both their code and their execution state. Theseexecution environments can exist in a variety of devices in a datanetwork including, but not limited to, servers, desktops, laptops,embedded devices, networking equipment and edge devices such as PDAs orcell phones. The characteristics of these platforms may vary widely Anagent must be able to adapt to these in terms of computational capacity,networking capacity, display capabilities, etc. conditions.

Historically, agents have been programmed in a procedural manner. Thatis, agents are programmed with a series of steps that will ultimatelyresult in a goal being achieved. This approach has limitations though asthe logic for each agent must be compiled into the agent software and istherefore static. Complex goals can also become intractable for aprogrammer as the set of rules the agent must follow grows.

Rule-Based Systems

In his tutorial, Introduction to Rule-Based Systems, JamesFreeman-Hargis defines a rule-based system to consist of a set ofassertions and a set of rules for how to act on the assertion set. Whena set of data is supplied to the system, it may result in zero or morerules firing. Rule based systems are rather simplistic in nature,consisting of little more than a group of if-then statements, but formthe basis of many “ expert systems. ” In an expert system, the knowledgeof an expert is encoded into the rule-set. When a set of data issupplied to the system, the system will come to the same conclusion asthe expert. With this approach there is a clear separation between thedomain logic (a rule set) and the execution of the agent. As mentioned,the procedural agent approach tightly couples the two.

The rule-based system itself uses a simple technique. It starts with arule-set, which contains all of the appropriate knowledge encoded intoIf-Then rules, and a working memory, which mayor may not initiallycontain any data, -assertions or initially known information. The systemin operation examines all the rule conditions (IF) and determines asubset, the conflict set, of the rules whose conditions are satisfiedbased on the working memory. Of this conflict set, one of those rules istriggered (fired). The rule that is chosen is based on a conflictresolution strategy. When the rule is fired, any actions specified inits THEN clause are carried out. These actions can modify the workingmemory, the rule-set itself, or do just about anything else the systemprogrammer decides to include. This loop of firing rules and performingactions continues until one of two conditions are met: there are no morerules whose conditions are satisfied or a rule is fired whose actionspecifies the rule engine execution should terminate.

Rule-based systems, as defined above, are adaptable to a variety ofproblems. In some problems, working memory asserted data is providedwith the rules and the system follows them to see where they lead. Thisapproach is known as forward-chaining An example of this is a medicaldiagnosis in which the problem is to diagnose the underlying diseasebased on a set of symptoms (the working memory). A problem of thisnature is solved using a forward-chaining, data-driven, system thatcompares data in the working memory against the conditions (IF parts) ofthe rules and determines which rules to fire.

In other problems, a goal is specified and the system must find a way toachieve that specified goal. This is known as backward-chaining Forexample, if there is an epidemic of a certain disease, this system couldpresume a given individual had the disease and attempt to determine ifits diagnosis is correct based on available information. Abackward-chaining, goal-driven, system accomplishes this. To do this,the system looks for the action in the THEN clause of the rules thatmatches the specified goal. In other words, it looks for the rules thatcan produce this goal. If a rule is found and fired, it takes each ofthat rule's conditions as goals and continues until either the availabledata satisfies all of the goals or there are no more rules that match.

The Rete algorithm is an efficient pattern matching algorithm forimplementing forward-chaining, rule-based systems. The Rete algorithmwas designed by Dr. Charles L. Forgy of Carnegie Mellon University in1979. Rete has become the basis for many popular expert systems,including JRules, OPS5, CLIPS, JESS, Drools, and LISA.

A naïve implementation of a rule-based system might check each ruleagainst the known facts in the knowledge base, firing that rule ifnecessary, then moving on to the next rule (and looping back to thefirst rule when finished). For even moderate sized rules and factknowledge-bases, this naïve approach performs far too slowly.

The Rete algorithm (usually pronounced either ‘REET’ or ‘REE-tee’, fromthe Latin ‘rete’ for net, or network) provides the basis for a moreefficient implementation of an expert system. A Rete-based expert systembuilds a network of nodes, where each node (except the root) correspondsto a pattern occurring in the left-hand-side of a rule. The path fromthe root node to a leaf node defines a complete rule left-hand-side.Each node has a memory of facts which satisfy that pattern.

As new facts are asserted or modified, they propagate along the network,causing nodes to be annotated when that fact matches that pattern. Whena fact or combination of facts causes all of the patterns for a givenrule to be satisfied, a leaf node is reached and the corresponding ruleis triggered.

The Rete algorithm is designed to sacrifice memory for increased speed.In most cases, the speed increase over naive implementations is severalorders of magnitude (because Rete performance is theoreticallyindependent of the number of rules in the system). In very largesystems, however, the original Rete algorithm tends to run into memoryconsumption problems which have driven the design of Rete variants.

Therefore, what is needed is an ability to dynamically determine neededagent rules. More specifically what is needed is dynamic determinationof the rules an agent will carry from a first execution environment to asecond execution environment.

SUMMARY

The present disclosure provides a system, method, and computer readablemedium for dynamic determination of the rules an agent will carry from afirst execution environment to a second execution environment.

In one embodiment of the present disclosure, a method for updating rulestatistics in an execution environment by an agent that utilizes a ruleengine, comprising collecting an activation statistic when a rule isactivated, collecting a firing statistic when a rule is fired; andstoring the activation statistic and the firing statistic in a rulehistory once processing by the rule engine is complete. The method mayalso comprise the rule engine collecting the activation statistic when arule is activated and colleting the firing statistic when the rule isfired. The method may additionally comprise the agent collecting theactivation statistic when a rule is activated and colleting the firingstatistic when the rule is fired. The method may further comprisecollecting a time the rule was activated or fired. The method may alsocomprise collecting a number of times a goal in a condition of the rulewas matched. The method may additionally comprise collecting a number oftimes any part in a condition of the rule was matched. The method mayfurther comprise collecting the activation and firing statistics fromthe rule engine or agent when rule processing completes. The method mayalso comprise storing a unique agent identifier in the agent which isknown by the agent and an originator of the agent. Wherein the agent hasa unique identifier, the method may additionally comprise adding therule statistics, indexed by the agent identifier, to an aggregate rulehistory in a rule repository. Wherein the rule statistic is stored inthe rule repository, the method may also comprise rule statistic beingstored for a rule that mayor may not be resident in the rule repository.

In another embodiment of the present invention, a computer readablemedium for dynamically removing an unnecessary rule as part of moving anagent that utilizes a rule engine from a first execution environment toa second execution environment comprising instructions for requesting aset of canonical rules that can be carried from the first executionenvironment to the second execution environment, merging the requestedrules with the set of canonical rules carried to the first executionenvironment to form a total possible rule set, pruning the totalpossible rule set, the result of which is a pruned rule set, encodingthe agent and the pruned rule set into a transferable form and sendingthe encoded agent and the pruned rule set to the second executionenvironment. The computer readable medium may also comprise instructionsfor storing a previous agent outcome indexed by an agent identifier inthe agent. The computer readable medium may additionally compriseinstructions for requesting the set of rules that can be carried fromthe first execution environment to the second execution environment froma rule repository in the first execution environment. The computerreadable medium may further comprise instructions for requesting a rulehistory from the rule repository in the first execution environment. Thecomputer readable medium may also comprise instructions for determiningthe unnecessary rule by comparing a previous agent outcome against therule history. The computer readable medium may additionally compriseinstructions for using rule activation or firing as a criterion for ruleinclusion or exclusion. The computer readable medium may furthercomprise instructions for using a rule left hand side condition beingmet as a criterion for rule inclusion or exclusion. The computerreadable medium may also comprise instructions for verifying that anoutcome threshold has been met or exceeded before the rule is consideredfor removal.

In a further embodiment of the present invention, a system fordynamically removing an unnecessary rule from a rule set as part ofmoving an agent that utilizes a rule engine from a first executionenvironment to a second execution environment comprising a first memoryand a first processor communicably coupled to the first memory, whereinthe processor collects a rule statistic during rule engine execution,records the rule statistic in the rule repository, records an outcome ofthe agent, compares the rule statistic to the agent outcome and prunesthe unnecessary rule from the agent rule set. The system may furthercomprise a second memory that stores an agent originator and a secondprocessor communicably coupled to the second memory, wherein the secondprocessor creates a unique agent identifier, creates a new agent, startsthe agent and records the agent outcome against the agent identifier.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating an exemplary process of constructing anagent locally with a set of canonical rules supplied duringconstruction;

FIG. 2 is a diagram illustrating an exemplary process of constructing anagent remotely with a set of canonical rules supplied duringconstruction;

FIG. 3 is a diagram illustrating an exemplary process of constructing anagent in a remote execution environment during which a set of canonicalrules is retrieved from outside the execution environment;

FIG. 4 is a diagram illustrating an exemplary process of moving an agentcarrying canonical rules from a first execution environment;

FIG. 5 is a diagram illustrating an exemplary process of moving an agentcarrying canonical rules to a second execution environment;

FIG. 6 is a diagram illustrating an exemplary process of an agentutilizing a rule-based system engine for execution;

FIG. 7 is a diagram illustrating an exemplary process of constructing anagent locally with a set of compiled rules supplied during construction;

FIG. 8 is a diagram illustrating an exemplary process of constructing anagent remotely with a set of compiled rules supplied duringconstruction;

FIG. 9 is a diagram illustrating an exemplary process of constructing anagent remotely during which a set of compiled rules that are retrievedfrom outside the execution environment;

FIG. 10 is a diagram illustrating an exemplary process of moving anagent carrying compiled rules from a first execution environment;

FIG. 11 is a diagram illustrating an exemplary process of moving anagent carrying compiled rules to a second execution environment;

FIG. 12 is a diagram illustrating an exemplary process of constructingan agent remotely with a set of canonical rules carried by the agent anda set of canonical execution environment rules resident in a remoteenvironment;

FIG. 13 is a diagram illustrating an exemplary process of constructingan agent remotely with a set of canonical rules fetched by the agent anda set of canonical execution environment rules resident in a remoteenvironment;

FIG. 14 is a diagram illustrating an exemplary process of moving anagent carrying canonical rules from a first execution environment thatincludes execution environment rules;

FIG. 15 is a diagram illustrating an exemplary process of moving anagent carrying canonical rules to a second execution environment thatincludes a repository of canonical execution environment rules;

FIG. 16 is a diagram illustrating an exemplary process of constructingan agent at a remote location with an as-needed set of canonical rulessupplied during construction;

FIG. 17 is a diagram illustrating an exemplary process of constructingan agent at a remote location with an as-needed set of canonical rulesfetched during construction;

FIG. 18 is a diagram illustrating an exemplary process of moving anagent with supplied as-needed canonical rules from a first executionenvironment;

FIG. 19 is a diagram illustrating an exemplary process of moving anagent with supplied as-needed canonical rules to a second executionenvironment;

FIG. 20 is a diagram illustrating an exemplary process of moving anagent from a first execution environment with a fetched as-needed set ofcanonical rules;

FIG. 21 is a diagram illustrating an exemplary process of moving anagent to a second execution environment with a fetched as-needed set ofcanonical rules;

FIG. 22 is a diagram illustrating an exemplary process of a rule-basedagent updating rule history when rule processing is halted in anexecution environment;

FIG. 23 is a diagram illustrating an exemplary process of a rule-basedagent identifying and carrying only needed canonical rules during aspart of movement to another execution environment;

FIG. 24 is a diagram illustrating an exemplary process of an agent usinga set of survival rules to determine its lifespan; and

FIG. 25 is a diagram illustrating an exemplary process of an agent usinga set of data narrowing rules to determine how much data should be sentover the network.

DETAILED DESCRIPTION

Construction

Agents which utilize rule based systems may be constructed locally orremotely. In order to operate, these agents need an initial set ofcanonical rules that can be compiled and loaded into an associated ruleengine. These rules can either be supplied at construction or a rulerepository location can be supplied so that the rules may be fetchedduring construction or at a later time.

Referring now to FIG. 1, a diagram illustrating an exemplary process ofconstructing an agent locally with a set of canonical rules suppliedduring construction is shown. An application 110, in an executionenvironment 112, requests a set of rules for an agent from a rulerepository 116 based on the goals of the agent that is being created.The result is a collection of canonical rules, known as a rule set 118.The rule set 118 is passed to the agent 120 during construction. Theagent 120 takes the rule set 118 and requests that it be compiled by thelocal rule compiler 122. This results in the creation of a compiled ruleset 124. At this point the agent creates the rule engine 126 that willbe used to execute the rule set. Note that if the execution environment112 includes a rule engine, then one may not need to be created. Afterthe rule engine 126 is created or located, the agent 120 supplies theengine 126 with the compiled rule set 124. Finally, the agent 120requests a new working memory 128 from the rule engine 126. The workingmemory will hold all of the data the agent chooses to assert before andduring execution of the rule engine. At this point, the agent 120 isready to be moved to another execution environment or to execute therule engine. Both of these processes are described in detail in latersections.

Referring now to FIG. 2, a diagram illustrating an exemplary process ofconstructing an agent remotely with a set of canonical rules suppliedduring construction is shown. An application 218, in executionenvironment 212, requests a set of rules for an agent from a rulerepository 220 in execution environment 214 based on the goals of theagent that is being created. The result is a collection of canonicalrules, known as a rule set 222. The rule set 222 is passed to the agent224 during construction in execution environment 216. The agent 224 inexecution environment 216 takes the rule set 222 and requests that it becompiled by the local rule compiler 226. This results in the creation ofa compiled rule set 228. At this point the agent creates the rule engine230 that will be used to execute the rule set. Note that if executionenvironment 216 includes a rule engine, then one may not need to becreated. After the rule engine 230 is created or located, the agent 224supplies the engine 230 with the compiled rule set 228. Finally, theagent 224 requests a new working memory 232 from the rule engine 230.The working memory will hold all of the data the agent chooses to assertbefore and during execution of the rule engine. At this point, the agent224 is ready to be moved to another execution environment or to executethe rule engine.

Referring now to FIG. 3, a diagram illustrating an exemplary process ofconstructing an agent in a remote execution environment during which aset of canonical rules is retrieved from outside the executionenvironment is shown. An application 318, in execution environment 312,requests the creation of an agent 324 in execution environment 316.Agent 324 is passed the location of a rule repository 320 duringconstruction. During construction, the agent 324 requests a set of rulesbased on its goals from the rule repository 320 in execution environment314. The result is a collection of canonical rules, known as a rule set322. The agent 324 in execution environment 316 takes the rule set 322and requests that it be compiled by the local rule compiler 326. Thisresults in the creation of a compiled rule set 328. At this point theagent creates the rule engine 330 that will be used to execute the ruleset. Note that if execution environment 314 includes a rule engine, thenone may not need to be created. After the rule engine 330 is created orlocated, the agent 324 supplies the engine 330 with the compiled ruleset 328. Finally, the agent 324 requests a new working memory 332 fromthe rule engine 330. The working memory will hold all of the data theagent chooses to assert before and during execution of the rule engine.At this point, the agent 324 is ready to be moved to another executionenvironment or to execute the rule engine.

Movement

An agent may move from one execution environment to another. Thisprocess may be initiated by a variety of means including but not limitedto an application, another agent, another object, the existing agentitself, a human interacting with the execution environment or a ruleexecuting in the agent's rule engine.

Referring; now to FIGS. 4 and 5, diagrams illustrating an exemplaryprocess of moving an agent carrying canonical rules from one executionenvironment to another are shown. An application 418 in executionenvironment 412 requests that an agent 424 in execution environment 414move to execution environment 416. The location of execution environment416 may be described in the move request by an IP address and port,Uniform Resource Locator (URL) , or any other means of addressing. Theagent 424 discards its rule engine 430 along with the associatedcompiled rule set 428 and working memory 432. The agent 424 then encodesitself along with its canonical rule set 422 into a transferable form434. Though a byte array is shown, the encoded agent could take any formthat can be transferred between the two execution environments. Once theagent 424 has created an encoded version of itself 434 in executionenvironment 414 it transfers the encoded version 434 to an agent manager426 residing in execution environment 416.

Referring now to FIG. 5, the process continues with the agent manager522 receiving the encoded agent 534. Upon receipt of the encoded agent534, the agent manager 522 decodes the encoded agent 534 into a newversion of the agent 524 and the agent's canonical rule set 526 inexecution environment 516. Once the agent 524 and rule set 526 have beenmaterialized, the agent manager 522 requests that the agent 524initialize. This request prompts the agent 524 to go to the executionenvironment's rule compiler 520 and request compilation of its canonicalrule set 526. The result is a compiled rule set 528. The agent thencreates a new rule engine 530 and subsequently passes the compiled ruleset 528 to it. As during construction, if the execution environment hasa rule engine, then one may not need to be created. Once the engine 530has been located/created and the compiled rule set 528 has been added toit, the agent 524 requests a new working memory from the rule engine. Asbefore, the working memory will hold all of the data the agent choosesto assert before and during execution of the rule engine. At this point,the agent 524 is ready to execute the rule engine. Once the moveoperation completes, the old version of the agent 518 in executionenvironment 514 indicates to the requesting application 518 in executionenvironment 512 that the move operation has completed. Once thenotification has been made, the old agent 534 is destroyed.

Execution

Once an agent has been initialized in an execution environment througheither creation or movement, it can be sent requests to performdifferent tasks. These tasks mayor may not require sending one or moreresponses. Recall that during construction an agent is associated with anewly created or resident rule engine and that a rule set is provided tothat engine.

Referring now to FIG. 6, a diagram illustrating an exemplary process ofan agent utilizing a rule-based system engine for execution is shown. Anapplication 616 in execution environment 612 sends a request to an agent618 in execution environment 614. Upon receiving the request, the agent618, collects an initial set of data and asserts it into its workingmemory 624 in order to accomplish the task requested. Note that thisdata may be collected from the local execution environment, from anaccessible database, from other objects, from other agents, from a humanvia a man machine interface, from a computer readable medium or anycombinations of the above. With a provided compiled rule set 620, and aninitial set of data in working memory 624, the rule engine 622 is thenstarted by the agent 618.

When the engine 622 starts, it processes the objects in working memoryagainst the rule set 620. This may result in one or more rules beingfired by the engine 622. When a rule is fired it may add, modify ordelete objects in working memory 624. Additionally, the engine 622 caninform the agent 618 which may result in a number of actions being takenby the agent 618 including, but not limited to, the collection andassertion of additional data into the working memory 624 (shown) and/orsending of a preliminary response back to the application. This sequencewill continue until the task is completed, there are no more rulesavailable to fire, or the agent receives an event, such as move orterminate, causing it to halt rule engine processing. Upon completion ofthe task, the agent 618 may send a response back to the application 616that initiated the request (shown).

Pre-Compiled Agent Rule Set Usage

As noted above, the process of adding rules to the rule engine can beexpensive in terms of CPU utilization on the execution environment inwhich the operation is performed. This can be problematic for lesspowerful hosts such as personal devices (cell phones, PDAs, etc.) andservers with limited available CPU resources. Therefore, anotherembodiment of the invention creates the compiled rule set in theexecution environment of the application that creates an agent insteadof in the environment in which the agent is constructed or moved.

Referring now to FIG. 7, a diagram illustrating an exemplary process ofconstructing an agent locally with a set of compiled rules suppliedduring construction is shown. An application 712, in executionenvironment 714, requests a set of rules for an agent from a rulerepository 720 based on the goals of the agent that is being created.The result is a collection of canonical rules, known as a rule set 724.The application 712 takes the rule set 724 and requests that it becompiled by the local rule compiler 722. This results in the creation ofa compiled rule set 724. The rule set 724 is passed to the agent 718during construction. At this point the agent creates the rule engine 726that will be used to execute the rule set. Note that if the executionenvironment 714 includes a rule engine, then one may not need to becreated. After the rule engine 726 is created or located, the agent 722supplies the engine 726 with the compiled rule set 724. Finally, theagent 110 requests a new working memory 728 from the rule engine 726.The working memory will hold all of the data the agent chooses to assertbefore and during execution of the rule engine. At this point, the agent718 is ready to be moved to another execution environment or to executethe rule engine.

Referring now to FIG. 8, a diagram illustrating an exemplary process ofconstructing an agent remotely with a set of compiled rules suppliedduring construction is shown. An application 812, in executionenvironment 814, requests a set of rules for an agent from a rule server828 in execution environment 818 based on the goals of the agent that isbeing created. The rule server 828 queries a rule repository 830 for therules. The result is a collection of canonical rules, known as a ruleset 832. The rule server 828 in execution environment 202 takes the ruleset 832 and requests that it be compiled by the local rule compiler 834.This results in the creation of a compiled rule set 826. The compiledrule set 826 is passed to the agent 820 during construction in executionenvironment 204. At this point, the agent 820 creates the rule engine822 that will be used to execute the rule set. Note that if executionenvironment 816 includes a rule engine, then one may not need to becreated. After the rule engine 822 is created or located, the agent 820supplies the engine 822 with the compiled rule set 826. Finally, theagent 820 requests a new working memory 116 from the rule engine 822.The working memory will hold all of the data the agent chooses to assertbefore and during execution of the rule engine. At this point, the agent820 is ready to execute the rule engine.

Referring now to FIG. 9, a diagram illustrating an exemplary process ofconstructing an agent in a remote execution environment during which aset of compiled rules is retrieved from outside the executionenvironment is shown. An application 912, in execution environment 914,requests the creation of an agent 920 in execution environment 916.Agent 920 is passed the location of a rule server 928, resident inexecution environment 918, during construction. During construction, theagent 920 requests a set of compiled rules based on its goals from therule server 928 in execution environment 918. The rule server 928queries a rule repository 930 for a set of rules. The result is acollection of canonical rules, known as a rule set 932. The rule server928 in execution environment 918 takes the rule set 932 and requeststhat it be compiled by the local rule compiler 934. This results in thecreation of a compiled rule set 926. At this point the agent 920 createsa rule engine 922 that will be used to execute the rule set. Note thatif execution environment 916 includes a rule engine, then one may notneed to be created. After the rule engine 922 is created or located, theagent 920 supplies the engine 922 with the compiled rule set 926.Finally, the agent 920 requests a new working memory 924 from the ruleengine 922. The working memory will hold all of the data the agentchooses to assert before and during execution of the rule engine. Atthis point, the agent 920 is ready to execute the rule engine.

Referring now to FIGS. 10-11, diagrams illustrating an exemplary processof moving an agent carrying compiled rules from one executionenvironment to another are shown. An application 1018 in executionenvironment 1012 request that an agent 1022 in execution environment1014 move to execution environment 1016. The location of executionenvironment 1016 may be described in the move request by an IP addressand port, Uniform Resource Locator (URL), or any other means ofaddressing. The agent 1022 discards its rule engine 1030 along with theassociated working memory 1032. Subsequently, the agent 1022 discardsits canonical rule set 1020 if it still has a reference to it. The agent1022 then encodes itself along with its compiled rule set 1028 into atransferable form 1024. Though a byte array is shown, the encoded agentcould take any form that can be transferred between the two executionenvironments. Once the agent 1022 has created an encoded version ofitself 1024 in execution environment 1014 it transfers the encodedversion 1024 to an agent manager 1026 residing in execution environment1016.

Referring now to FIG. 11, the process continues with an agent manager1122 receiving an encoded agent 1134. Upon receipt of the encoded agent1134, the agent manager 1122 decodes the encoded agent 1134 into a newversion of the agent 1124 and its compiled rule set 1128 in executionenvironment 1116. Once the agent 1124 and rule set 1128 have beendecoded, the agent manager 1122 requests that the agent 1124 initialize.This request prompts the agent 124 to create a new rule engine 1130 andsubsequently pass the compiled rule set 1128 to it. As duringconstruction, if the execution environment has a rule engine, then onemay not need to be created. Once the engine 1130 has beenlocated/created and the compiled rule set 1128 has been added to it, theagent 1124 requests a new working memory 1132 from the rule engine. Asbefore, the working memory will hold all of the data the agent choosesto assert before and during execution of the rule engine. At this point,the agent 1124 is ready to execute the rule engine. Once the moveoperation completes, the old version of the agent 1118 in executionenvironment 1114 indicates to the requesting application 1118 inexecution environment 1112 that the move operation has completed. Oncethe notification has been made, the old agent 1118 is destroyed.

Execution Environment Rule set Usage

Each execution environment may have access to a local rule repositorywhich allow for the rules for a particular domain, domain rules, to bedistributed, or partitioned, in any number of rule repositories. Anagent may be configured to only use rules provided at constructionessentially ignoring rules available from each execution environment'slocal rule repository. The more general case is for the agent to makeuse of the rules that it carries with itself along with the rulesextracted from the execution environment's local rule repository. Localrule repositories may contain rules for several different domains andare usually specific to execution environment objects that will beasserted to working memory but may also apply to execution environmentconcerns such as security, resource usage, scheduling, or any otherexecution environment attribute.

Referring now to FIG. 12, a diagram illustrating an exemplary process ofconstructing an agent remotely with a set of canonical rules carried bythe agent and a set of canonical rules resident in a remote environmentis shown. An application 1218, in execution environment 1212, requests aset of rules for an agent from a rule repository 1220 in executionenvironment 1214 based on the goals of the agent that is being created.The result is a collection of canonical rules, known as a rule set 1230.The rule set 1230 is passed to the agent 1232 during construction inexecution environment 1216. During construction, the agent 1232 requeststhe set of rules from a local rule repository 1234 given the agent'sdomain (not shown). The result of which, canonical rule set 1236, isthen merged with the construction supplied rule set 1230 to form amerged rule set 1222. This rule set contains all the domain andenvironment specific rules that the agents' rule engine will execute.The agent 1232 then takes the merged rule set 1222 and requests that itbe compiled by the local rule compiler 1226. This results in thecreation of a compiled rule set 1238. At this point the agent creates arule engine 1224 that will be used to execute the rule set 1238. Notethat if execution environment 1216 includes a rule engine, then one maynot need to be created. After the rule engine 1224 is created orlocated, the agent 1232 supplies the engine 1224 with the compiled ruleset 1238. Finally, the agent 1232 requests a new working memory 1228from the rule engine 1224. The working memory will hold all of the datathe agent chooses to assert before and during execution of the ruleengine.

Referring now to FIG. 13, a diagram illustrating an exemplary process ofconstructing an agent remotely with a set of canonical rules fetched bythe agent and a set of canonical local rules resident in a remoteenvironment is shown. An application 1318, in execution environment1312, requests the creation of an agent 1332 in execution environment1316. Agent 1332 is passed the location of a rule repository 1320 duringconstruction. During construction, the agent 1332 requests a set ofrules based on its goals from the rule repository 1320 in executionenvironment 1314. The result is a collection of canonical rules, knownas a rule set 1330. During construction, the agent 1332 requests the setof rules from a local rule repository 1334 that apply to its domain. Theresult of which, canonical rule set 1336, is then merged with thefetched rule set 104 to form a merged rule set 1322. This rule setcontains all the domain and environment specific rules that the agents'rule engine will execute. The agent 1332 then takes the merged rule set1322 and requests that it be compiled by the local rule compiler 1326.This results in the creation of a compiled rule set 1338. At this pointthe agent creates a rule engine 1324 that will be used to execute therule set 1338. Note that if execution environment 1316 includes a ruleengine, then one may not need to be created. After the rule engine 1324is created or located, the agent 1332 supplies the engine 1324 with thecompiled rule set 1338. Finally, the agent 1332 requests a new workingmemory 1328 from the rule engine 1324. The working memory will hold allof the data the agent chooses to assert before and during execution ofthe rule engine.

Referring now to FIGS. 14-15, diagrams illustrating an exemplary processof moving an agent carrying canonical rules to an execution environmentthat includes a local repository of canonical rules are shown. Referringnow to FIG. 14, an application 1418 in execution environment 1412requests that an agent 1422 in execution environment 1414 move toexecution environment 1416. The location of execution environment 1416may be described in the move request by an IP address and port, UniformResource Locator (URL), or any other means of addressing. The agent 1422discards its rule engine 1430 along with the associated compiled ruleset 1428 and working memory 1432. The agent 1422 then encodes itselfalong with its canonical rule set 1420 into a transferable form 1424.Though a byte array is shown, the encoded agent could take any form thatcan be transferred between the two execution environments. Once theagent 1422 has created an encoded version of itself 1424 in executionenvironment 1414 it transfers the encoded version 1424 to an agentmanager 1426 residing in execution environment 1416.

Referring now to FIG. 15, the process continues with the agent manager1522 receiving the encoded agent 1534. Upon receipt of the encoded agent1534, the agent manager 1522 decodes the encoded agent 1534 into a newagent 1526 and its canonical rule set 1540 in execution environment1516. Once the agent 1526 and rule set 1540 have been decoded, the agentmanager 1522 requests that the agent 1526 initialize. This requestprompts the agent 1526 to request the set of rules applicable to theagent's domain from a local rule repository 1536. The result of which,canonical rule set 1538, is then merged with the carried rule set 1540to form a merged rule set 1534. This rule set contains all the domainand environment specific rules that the agents rule engine will execute.The agent 1526 then takes the merged rule set 1534 and requests that itbe compiled by the local rule compiler 1524.

The result is a compiled rule set 1528. The agent then creates a newrule engine 1530 and subsequently passes the compiled rule set 1528 toit. As during construction, if the execution environment has a sharablerule engine, then one may not need to be created. Once the engine 1530has been located/created and the compiled rule set 1528 has been addedto it, the agent 1526 requests a new working memory 1532 from the ruleengine. As before, the working memory will hold all of the data theagent chooses to assert before and during execution of the rule engine.Once the move operation completes, the old version of the agent 1520 inexecution environment 1514 indicates to the requesting application 1518in execution environment 1512 that the move operation has completed.Once the notification has been made, the old agent 1520 is destroyed.

As-Needed Rules

As there is a cost of carrying around unnecessary rules in terms of bothCPU and memory usage, it is desirable in many cases to supply an agentwith a subset of its total potential rule set. This can be done in acontext-specific manner based on the goals and execution environment ofthe agent. For example, if each device upon which an agent will beexecuting only contains a small screen, then there is no need to carrythe rules for display on a standard computer monitor. As anotherexample, an agent who moves progressively further in a single direction,perhaps among GPS enabled fixed location devices, need not carry rulesthat only apply to previous GPS locations.

Referring now to FIG. 16, a diagram illustrating an exemplary process ofconstructing an agent at a remote location with an as-needed set ofcanonical rules supplied during construction is shown. An application1618, in execution environment 1612, requests a set of rules for anagent from a rule repository 1620 in execution environment 1614 based onthe goals and initial execution environment of the agent that is beingcreated. When supplied with a target execution environment, the rulerepository 1620 can filter out rules that do not apply to that type ofenvironment. The result is a collection of canonical rules, known as arule set 1622. The rule set 1622 is passed to the agent 1624 duringconstruction in execution environment 1616. The agent 1624 in executionenvironment 1616 takes the rule set 1622 and requests that it becompiled by the local rule compiler 1626. This results in the creationof a compiled rule set 1628. At this point the agent creates the ruleengine 1630 that will be used to execute the rule set. Note that ifexecution environment 1616 includes a rule engine, then one may not needto be created. After the rule engine 1630 is created or located, theagent 1624 supplies the engine 1630 with the compiled rule set 1628.Finally, the agent 1624 requests a new working memory 1632 from the ruleengine 1630. The working memory will hold all of the data the agentchooses to assert before and during execution of the rule engine. Atthis point, the agent 1624 is ready to be moved to another executionenvironment or to execute the rule engine.

Referring now to FIG. 17, a diagram illustrating an exemplary process ofconstructing an agent at a remote location with an as-needed set ofcanonical rules fetched during construction is shown. An application1718, in execution environment 1712, requests the creation of an agent1724 in execution environment 1716. Agent 1724 is passed the location ofa rule repository 1720 during construction. During construction, theagent 1724 requests a set of rules based on its goals and executionenvironment from the rule repository 1720 in execution environment 1714.When supplied with the target execution environment, the rule repository1720 can filter out rules that do not apply to that type of environment.The result is a collection of canonical rules, known as a rule set 1722.The agent 1724 in execution environment 204 takes the rule set 1722 andrequests that it be compiled by the local rule compiler 1726. Thisresults in the creation of a compiled rule set 1728. At this point theagent creates the rule engine 1730 that will be used to execute the ruleset. Note that if execution environment 1714 includes a rule engine,then one may not need to be created. After the rule engine 1730 iscreated or located, the agent 1724 supplies the engine 1730 with thecompiled rule set 1728. Finally, the agent 1724 requests a new workingmemory 1732 from the rule engine 1730. The working memory will hold allof the data the agent chooses to assert before and during execution ofthe rule engine. At this point, the agent 1724 is ready to be moved toanother execution environment or to execute the rule engine.

Referring now to FIGS. 18-19, diagrams illustrating an exemplary processof moving an agent from one execution environment to another with asupplied as-needed set of canonical rules are shown. An application 1818in execution environment 1812 requests that an agent 1822 in executionenvironment 1814 move to execution environment 1816. The location ofexecution environment 1816 may be described in the move request by an IPaddress and port, Uniform Resource Locator (URL), or any other means ofaddressing. The move request includes a new as-needed canonical rule set1834 based on the agent's goals and target execution environment. Theagent 1822 discards its rule engine 1830 along with the associatedcompiled rule set 1828 and working memory 1832. In addition the agent1822 discards its old canonical rule set 1820. At this point, the agent1822 encodes itself along with its new as-needed canonical rule set 1834into a transferable form 1824. Though a byte array is shown, the encodedagent could take any form that can be transferred between the twoexecution environments. Once the agent 1822 has created an encodedversion of itself 1824 in execution environment 1814 it transfers theencoded version 1824 to an agent manager 1826 residing in executionenvironment 1816.

Referring now to FIG. 19, the process continues with the agent manager1922 receiving an encoded agent 1934. Upon receipt of the encoded agent1934, the agent manager 118 decodes the encoded agent 1934 into a newversion of the agent 1924 and its new canonical rule set 1926 inexecution environment 1916. Once the agent 1924 and rule set 1926 havebeen materialized, the agent manager 1922 requests that the agent 1922initialize. This request prompts the agent 1922 to go to the executionenvironments' rule compiler 1920 and request compilation of itscanonical rule set 1926. The result is a compiled rule set 1928. Theagent then creates a new rule engine 1930 and subsequently passes thecompiled rule set 1928 to it. As during construction, if the executionenvironment has a rule engine, then one may not need to be created. Oncethe engine 1928 has been located/created and the compiled rule set 1926has been added to it, the agent 1922 requests a new working memory fromthe rule engine. As before, the working memory will hold all of the datathe agent chooses to assert before and during execution of the ruleengine. Once the move operation completes, the old version of the agent1918 in execution environment 1914 indicates to the requestingapplication 1918 in execution environment 1912 that the move operationhas completed. Once the notification has been made, the old agent 1934is destroyed.

Referring now to FIGS. 20-21, diagrams illustrating an exemplary processof moving an agent from one execution environment to another with afetched as-needed set of canonical rules are shown. An application 2018in execution environment 2012 requests that an agent 2022 in executionenvironment 2014 move to execution environment 2016. The location ofexecution environment 2016 may be described in the move request by an IPaddress and port, Uniform Resource Locator (URL), or any other means ofaddressing. The move request includes a reference to a rule repository2038 from which the agent should fetch a new as-needed rule set. Uponreceiving the move request, the agent 2022 requests a new as-needed ruleset from the supplied rule repository 2038 based on its goals and targetexecution environment 2016. After receiving the new canonical rule set2034, the agent 2022 discards its rule engine 2030 along with theassociated compiled rule set 2028 and working memory 2032. In additionthe agent 2022 discards its old canonical rule set 2020. At this point,the agent 2022 encodes itself along with its new as-needed canonicalrule set 2034 into a transferable form 2024. Though a byte array isshown, the encoded agent could take any form that can be transferredbetween the two execution environments. Once the agent 2022 has createdan encoded version of itself 2024 in execution environment 2014 ittransfers the encoded version 2024 to an agent manager 2026 residing inexecution environment 2016.

Referring now to FIG. 21, the process continues with the agent manager2122 receiving an encoded agent 2134. Upon receipt of the encoded agent2134, the agent manager 2122 decodes the encoded agent 2134 into a newversion of the agent 2124 and its new canonical rule set 2126 inexecution environment 204. Once the agent 2124 and rule set 124 havebeen materialized, the agent manager 2122 requests that the agent 2124initialize. This request prompts the agent 2124 to go to the executionenvironment's rule compiler 2120 and request compilation of itscanonical rule set 2126. The result is a compiled rule set 2128. Theagent then creates a new rule engine 130 and subsequently passes thecompiled rule set 2128 to it. As during construction, if the executionenvironment has a sharable rule engine, then one may not need to becreated. Once the engine 2130 has been located/created and the compiledrule set 2126 has been added to it, the agent 2124 requests a newworking memory from the rule engine. As before, the working memory willhold all of the data the agent chooses to assert before and duringexecution of the rule engine. Once the move operation completes, the oldversion of the agent 2138 in execution environment 2114 indicates to therequesting application 2118 in execution environment 2112 that the moveoperation has completed. Once the notification has been made, the oldagent 2138 is destroyed.

Dynamic Determination Of Needed Rules

Large rule sets, even with efficient algorithms such as Rete, are oftenexpensive in computation and bandwidth. The process of dynamicallyremoving rules considered unlikely to be useful has a benefit toperformance and also, combined with mobile agents, provides an efficientmethod for utilizing large rule sets that can be partitioned across manyrepositories. This method also allows an agent to dynamically change therules to meet the execution environment processing task.

Each constructed agent has a unique identifier for itself and thisidentifier is also known to the agent's originator. At the point oforigination, this identifier will be associated with the agent'soutcome. An example outcome is successfully attaining an end goal andsending the results back to the application. Another example outcome isthe loss or death of the agent. An agent that is determined to be lostor dead may cause a replacement agent to be launched. The replacementagent will have a unique identifier that differs from the originalagent. In addition to a unique agent identifier, an agent also carrieswith it an indicative subset of the set of previously completed agentoutcomes for the given domain. This is a set of unique identifiers andoutcomes for agents that have previously executed in the domain of thecurrent agent.

In each execution environment, the local rule repository not only storesrules, but is also the location for agents to record statistics aboutrule engine activity for the rules in the rule set given to the ruleengine. These instrumented rules include agent carried rules and rulesfor the domain that were retrieved from the local rule repository.Alternately, only the locally acquired domain rules may be instrumented.

Referring now to FIG. 22, a diagram illustrating an exemplary process ofa rule-based agent updating rule statistics when rule processing hascompleted in an execution environment is shown. As before, an agent 2218starts its associated rule engine 2222 to process its compiled rule set2220. During the course of execution, the rule engine 2222 maysuccessfully match part of the condition (left hand side) of a rule, maymatch the condition of a rule and activate it, or may match and activateand fire a rule (perform the consequences of the rule). A rule enginemay provide for collection of the statistics for the phases of ruleactivity mentioned. Alternately, the agent may integrate listener codeto monitor these phases of rule execution and collect the statistics asthe rule engine executes. A rule being fired may result in the ruleasserting new data into the working memory 2224 and/or the agent 2218collecting more data and asserting that into the working memory 2224.Once an end goal terminates rule processing, or the agent receives amove event, a termination event, a timeout or some other event, then therule engine is halted. At this point, the agent 2218 requests rulestatistics from the rule engine 2222 or collects the statistics from theagent's rule engine listener. These statistics may include, but are notlimited to the number of times a rule was fired, the number of times arule was activated, the number of times a goal in the condition of arule was matched, the number of times a part of the condition of a rulewas matched, or any combination of the above. The statistics 2226 arethen added to aggregate rule history stored in the local rule repository2216. These stored statistics may include statistics for rules that arenot available in the local rule repository since an agent can carryrules with it as it moves.

When the agent prepares to move to another execution environment itdynamically determines to remove unnecessary rules by consulting therule history associated with some or all of the rules in its currentrule set in conjunction with the indicative subset of previouslycompleted agent outcomes that the agent carries. Referring now to FIG.23, a diagram illustrating an exemplary process of a rule-based agentdynamically removing unnecessary rules as part of movement to anotherexecution environment is shown. An application 2318 requests that anagent 2326 in execution environment 2314 move to execution environment2316. The agent 2326 requests a set of rules from the local rulerepository 2322 that are allowed to be carried to other platforms. Theresult is a canonical rule set 2334. This rule set is then merged withthe set of rules 2320 that the agent 2326 carried with it to executionenvironment 2314. The result is canonical rule set 2336.

At this point the agent consul is the local rule repository 2322 to getthe rule history 2330 of the rules in set 2336. The agent 2326 then usesthe rule history 2330 with its carried set of previous agent outcomes toremove rules from rule set 116 that are unlikely to participate in adesired outcome. The statistics are used in aggregate form. As anexample consider an agent that carries the results of 2318 previouslyexecuted agents and their outcomes, 50 of which were desirable outcomes.The agent examines the metrics for a particular rule named “A” whichshows that it was never activated. The agent then removes rule “A” fromits agent carried rule set. As another example consider rule “B” whichhas been activated and fired in one-third of previous desirable outcomesbut also has been active and fired in nearly all negative outcomes. Rule“B” remains in the agent carried rule set. Finally, a rule, “C”, whichnever activates for any as yet recorded desired outcomes but has beenactive in almost all negative outcomes can be considered a computationalburden and removed from the agent carried rule set. Although activationis a criterion above, finer grained partial left-hand side matchingstatistics can be used as well. Since rule removal requires an aggregateof previous runs a threshold is provided so that no rule deletion ispermitted until a requisite number of outcomes has been obtained.

Once the pruned rule set 2332 has been created, the agent 2326 encodesitself along with its pruned rule set 2332 into a transferable form inexecution environment 2314. The agent 2326 then transfers the encodedversion of itself in execution environment 2314 to an agent manager 2346resident in the target execution environment 2316. The remainder of themove process follows that of FIG. 5.

Survivability Rules

All agents have a lifespan; but that lifespan need not be pre-determinedif a set of rules around survivability of an agent is put in place.These rules may be agent specific or execution environment specific.They may be carried with the agent or resident in a rule repository forthe execution environment. As these rules are like any other declarativerules, they may be any combination of the above according to theteachings of this invention. In addition, these rules may be used inconjunction with more typical survivability mechanisms such asheartbeats between the application and the agent.

Referring now to FIG. 24, a diagram illustrating an exemplary process ofan agent using a set of survival rules to determine its lifespan isshown. Agent survivability is controlled by the rules loaded in thelocal compiled rule set 2428. As before, the local rule set may becomprised of rules supplied or fetched from rule repository 2420 duringconstruction, rules carried from other visited execution environmentsand/or execution environment specific rules retrieved from rulerepository 2426. Many sources of data that may be asserted into theworking memory and, combined with the local rule set 2428, affect theagent's 2424 lifespan. Examples include lifespan update events fromapplication 2418, heartbeat events from application 2418, timer eventsfrom the execution environment's timer system 2434, and even statechange events from the agent 2424 itself. As data is asserted into theworking memory, the rules engine guarantees that applicable rules arefired. Any number of rules might result in the agent 2424 taking actionsthat affect its survivability. This includes death of the agent 2424which is shown. When an agent 104 dies it halts rule engine processing,records any collected historical statistics for the local rule set andstores these in the rule repository 2436.

Data Narrowing Rules

Agent may visit many execution environments each with differing levelsof network connectivity or an execution environment with multiplelevels/types of network connectivity. Given this, it is important thatan agent take this into consideration when responding to applicationrequests, sending periodic reports, and determining how much data tocarry with it when moving. As per the teachings of this invention,execution environment specific rules are an ideal method for insuringthe appropriate agent behavior. If the networking capabilities of theexecution environment are static, then rules for this may be maintainedin the rule repository on the execution environment running theapplication that launched the agent. In many cases though, thecapabilities may be more dynamic in which case the rules regardingnetwork bandwidth are better kept on the remote execution environment.

Referring now to FIG. 25, a diagram illustrating an exemplary process ofthe of an agent using a set of data narrowing rules to determine howmuch data should be sent over the network is shown. This diagram showsthe same agent in three different scenarios. As before, each agent iscommunicating with an application 2532 that in this case is hosted onserver 2530 which is connected to a high-speed data network, 2534. Inthe first scenario, the agent 2514 has been constructed on or moved toserver execution environment 2512, which is connected to the high speeddata network directly via a gigabit ethernet link 2544. The agent 2514utilized a rule-based system that is driven by the associated ruleengine 2516. This engine 2516 has been loaded with execution environmentspecific rules about the current network bandwidth capabilities of theexecution environment 2512. In this example the agent 106 completes atask which will ultimately generate a report back to the application2532 on execution environment 2530. When that task completes, that eventcauses a rule to fire in the engine 2516, which instructs the agent 2514to send a detailed report. In this case, a detailed report isappropriate because a high bandwidth connection is available between theagent 2514 and the application 2532.

In the second scenario, that same agent now labeled 114 has moved to ahome computer 2518 which is connected to the network via a DSLconnection 2546. As before, the engine 2522 is loaded with the executionenvironment specific rules regarding bandwidth available to theexecution environment. As the agent 2520 completes its task, the eventcauses a rule to fire, which instructs agent 2520 to send a full report,which contains less data than the detailed report described previously.Note, that the agent 2520 is not compressing the same data, but sendinga different data-set back - a subset of the data to fit the bandwidthavailable.

In the final scenario, the agent, now labeled 2526 has moved to themobile device 2524. The mobile device is connected to the high speeddata network via a relatively low speed cellular data network 2536. Asbefore, the agent 2526 completes its task which results in the ruleengine 2528 firing a rule. This firing causes the agent 2526 to dispatcha much smaller summary report to the application 2532 in order toaccommodate the low bandwidth connection.

Methods, computer readable media and systems have been shown and/ordescribed in the above embodiments for movement of an agent thatutilizes a compiled set of canonical rules. Although the abovedescriptions set forth embodiments, it will be understood that there isno intent to limit the invention by such disclosure, but rather, it isintended to cover all modifications and alternate implementationsfalling within the spirit and scope of the invention. For example, thepresent invention should not be limited to a single agent, or to aparticular programming language for the execution environment.Furthermore, the association of agent to execution environments is notlimited to the topology depicted. Lastly, the embodiments are intendedto cover capabilities and concepts whether they be via a loosely coupleset of components or they be converged into one or more integratedcomponents, devices, circuits, and/or software programs.

What is claimed is:
 1. A method comprising: collecting an activationstatistic when a rule is activated by a rule engine in an executionenvironment; collecting a trigger statistic when a rule is triggered;and storing the activation statistic and the rule statistic in a rulehistory of rule statistics once processing by the rule engine iscomplete.
 2. The method of claim 1, further comprising the rule enginecollecting the activation statistic when a rule is activated andcolleting the trigger statistic when the rule is triggered.
 3. Themethod of claim 1, further comprising the agent collecting theactivation statistic when a rule is activated and collecting the triggerstatistic when the rule is triggered.
 4. The method of claim 1, furthercomprising collecting a time the rule was activated or triggered.
 5. Themethod of claim 1, further comprising collecting a number of times agoal in a condition of the rule was matched.
 6. The method of claim 1,further comprising collecting a number of times any part in a conditionof the rule was matched.
 7. The method of claim 1, further comprisingcollecting the activation and trigger statistics from the rule engine oragent when rule processing completes.
 8. The method of claim 1, furthercomprising storing a unique agent identifier in the agent which is knownby the agent and an originator of the agent.
 9. The method of claim 8,further comprising adding the rule statistics, indexed by the agentidentifier, to an aggregate rule history in a rule repository.
 10. Themethod of claim 9, wherein the rule statistic stored is for a rule thatmay or may not be resident in the rule repository.
 11. A systemcomprising: a memory comprising a working memory; a rules engineconfigured to perform operations consistent with rules stored in theworking memory; an agent comprising instructions; and a processorconfigured to be communicably coupled to the memory and the rulesengine, wherein the processor is configured to: collect an activationstatistic when a rule is activated by the rule engine in an executionenvironment; collect a trigger statistic when a rule is triggered; andstore the activation statistic and the rule statistic in a rule historyof rule statistics once processing by the rule engine is complete. 12.The system of claim 11, wherein the rules engine is further configuredto collect the activation statistic when a rule is activated and collectthe trigger statistic when the rule is triggered.
 13. The system ofclaim 11, wherein the agent is further configured to collect theactivation statistic when a rule is activated and colleting the triggerstatistic when the rule is triggered.
 14. The system of claim 11,wherein the processor is further configured to collect a time the rulewas activated or triggered.
 15. The system of claim 11, wherein theprocessor is further configured to collect a number of times a goal in acondition of the rule was matched.
 16. The system of claim 11, whereinthe processor is further configured to collect a number of times anypart in a condition of the rule was matched.
 17. A tangible computerreadable medium comprising instructions stored thereon, the instructionscomprising: instructions to collect an activation statistic when a ruleis activated by a rule engine in an execution environment; instructionsto collect a trigger statistic when a rule is triggered; andinstructions to store the activation statistic and the rule statistic ina rule history of rule statistics once processing by the rule engine iscomplete.
 18. The tangible computer readable medium of claim 17, furthercomprising instructions to collect a time the rule was activated ortriggered.
 19. The tangible computer readable medium of claim 17,further comprising instructions to collect a number of times a goal in acondition of the rule was matched.
 20. The tangible computer readablemedium of claim 17, further comprising instructions to collect a numberof times any part in a condition of the rule was matched.